﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Operators.aspx.cs" Inherits="Operators" EnableEventValidation="false" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <asp:UpdatePanel runat="server">
        <ContentTemplate>

            <asp:Panel ID="emptyPanel" runat="server" visible="false">
                <div align="center">
                    <h1 > Operators </h1>
                </div>
            </asp:Panel>

            <asp:Panel ID="operatorsPanel" runat="server" visible="false" >
                <asp:button runat="server" ID="addNewTrainingButton" text="Adaugarea Unui nou Operator instruire" onclick="addNewTrainingButton_Click" />
                <hr />
                <asp:GridView ID="operatorsGridView" runat="server" 
                    EnableModelValidation="True" 
                    AutoGenerateColumns="False" 
                    CssClass="mGrid"
                    PagerStyle-CssClass="pgr"
                    AlternatingRowStyle-CssClass="alt"
                    AllowPaging="True"         
                    PageSize="10"
                    onpageindexchanging="operatorsGridView_PageIndexChanging" 
                    onrowdeleting="operatorsGridView_RowDeleting" 
                    onselectedindexchanged="operatorsGridView_SelectedIndexChanged" 
                    onrowdatabound="operatorsGridView_RowDataBound">
                    <AlternatingRowStyle CssClass="alt" />
                    <Columns>
                        <asp:BoundField DataField="OperatorID" HeaderText="OperatorID" HtmlEncode="false" HeaderStyle-CssClass="HiddenColumn" ItemStyle-CssClass="HiddenColumn" />
                        <asp:BoundField DataField="Nume" HeaderText="Nume" HtmlEncode="false" />     
                        <asp:BoundField DataField="Prenume" HeaderText="Prenume" HtmlEncode="false" />                     
                        <asp:BoundField DataField="genID" HeaderText="genID" HtmlEncode="false" HeaderStyle-CssClass="HiddenColumn" ItemStyle-CssClass="HiddenColumn" />   
                        <asp:BoundField DataField="genID_string" HeaderText="Gen" HtmlEncode="false" />                                       
                        <asp:BoundField DataField="Specializare" HeaderText="Specializare" HtmlEncode="false" />  
                        <asp:BoundField DataField="Adresa" HeaderText="Adresa" HtmlEncode="false" />  
                        <asp:BoundField DataField="TelefonFix" HeaderText="TelefonFix" HtmlEncode="false" />                  
                        <asp:BoundField DataField="TelefonGSM" HeaderText="TelefonGSM" HtmlEncode="false" />  
                        <asp:BoundField DataField="Email" HeaderText="Email" HtmlEncode="false" />                  
                        <asp:BoundField DataField="Organizatie" HeaderText="Organizatie" HtmlEncode="false" /> 
                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>
                                    <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Delete" OnClientClick="return confirm('Sunteti sigur ca vreti sa stergeti?');" />
                            </ItemTemplate>
                        </asp:TemplateField>  
                    </Columns>
                    <PagerStyle CssClass="pgr" />
                    <SelectedRowStyle BackColor="#CCCCFF" />
                </asp:GridView>
            </asp:Panel>

            <asp:Panel ID="addNewOperatorPanel" runat="server" Visible="False" >
                <div class="leftColumn">
                    <div class="module">
                        <div class="moduleHeader">Adaugarea noului Operator</div>
                        <div class="module_content">                          
                            <p>
                                <label> Numele: </label>
                                <asp:TextBox ID="addNewOperatorNumeTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Prenumele: </label>
                                <asp:TextBox ID="addNewOperatorPrenumeTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Gen: </label>
                                <asp:DropDownList ID="addNewOperatorGenDDL" runat="server" />
                            </p>
                            <p>
                                <label> Specializare: </label>
                                <asp:TextBox ID="addNewOperatorSpecializareTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Adresa: </label>
                                <asp:TextBox ID="addNewOperatorAdresaTextBox" runat="server" />
                            </p>
                        </div>
                    </div>
                </div>

                <div class="rightColumn">
                    <div class="module">
                        <div class="moduleHeader"></div>
                        <div class="module_content">                
                            <p>
                                <label> Telefon Fix: </label>
                                <asp:TextBox ID="addNewOperatorTelefonFixTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Telefon GSM: </label>
                                <asp:TextBox ID="addNewOperatorTelefonGSMTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Email: </label>
                                <asp:TextBox ID="addNewOperatorEmailTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Oragnizatie: </label>
                                <asp:TextBox ID="addNewOperatorOrganizatieTextBox" runat="server" />
                            </p>                  
                        </div>
                    </div>
                </div>

                <div class="clear"></div>

                <div class="centerBox" style="width:150px">
                    <asp:Button ID="addNewOperatorSaveButton"  runat="server" Text="Save" onclick="addNewOperatorSaveButton_Click"   />
                    <asp:Button ID="addNewOperatorCancelButton" runat="server" Text="Cancel"  onclick="addNewOperatorCancelButton_Click"  />
                </div>
            </asp:Panel>

            <asp:Panel ID="editOperatorPanel" runat="server" Visible="False" >
                <div class="leftColumn">
                    <div class="module">
                        <div class="moduleHeader">Editarea datelor perosnale Operatorului </div>
                        <div class="module_content">                             
                            <p>
                                <label> Numele: </label>
                                <asp:TextBox ID="editOperatorNumeTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Prenumele: </label>
                                <asp:TextBox ID="editOperatorPrenumeTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Gen: </label>
                                <asp:DropDownList ID="editOperatorGenDDL" runat="server" />
                            </p>
                            <p>
                                <label> Specializare: </label>
                                <asp:TextBox ID="editOperatorSpecializareTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Adresa: </label>
                                <asp:TextBox ID="editOperatorAdresaTextBox" runat="server" />
                            </p>
                        </div>
                    </div>
                </div>

                <div class="rightColumn">
                    <div class="module">
                        <div class="moduleHeader"></div>
                        <div class="module_content">                  
                            <p>
                                <label> Telefon Fix: </label>
                                <asp:TextBox ID="editOperatorTelefonFixTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Telefon GSM: </label>
                                <asp:TextBox ID="editOperatorTelefonGSMTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Email: </label>
                                <asp:TextBox ID="editOperatorEmailTextBox" runat="server" />
                            </p>
                            <p>
                                <label> Oragnizatie: </label>
                                <asp:TextBox ID="editOperatorOrganizatieTextBox" runat="server" />
                            </p>   
                            <asp:HiddenField ID="editOperatorIDHiddenField" runat="server" />
                        </div>
                    </div>
                </div>

                <div class="clear"></div>

                <div class="centerBox" style="width:150px">
                    <asp:Button ID="editOperatorSaveButton"  runat="server" Text="Save" onclick="editOperatorSaveButton_Click"   />
                    <asp:Button ID="editOperatorCancelButton" runat="server" Text="Cancel"  onclick="editOperatorCancelButton_Click"  />
                </div>
            </asp:Panel>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

